import request from '@/utils/request.js'

// 用户登录
export const login = (data) => {
  return request({
    method: 'POST',
    data,
    url: '/mp/v1_0/authorizations'
  })
}

// 获取用户基本信息
export const getUserInfo = () => {
  return request({
    method: 'GET',
    url: '/mp/v1_0/user/profile'
  })
}

export const updateUserInfo = (data) => {
  return request({
    method: 'PATCH',
    url: '/mp/v1_0/user/profile',
    data
  })
}

// 获取用户基本信息
export const saveUserPhoto = (data) => {
  return request({
    method: 'PATCH',
    url: '/mp/v1_0/user/photo',
    data
  })
}
